﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BookTransactionControllers.Services;
using BookTransactionModels;
using System.Data.SqlClient;
using BookTransactionControllers.Connection;

namespace BookTransactionControllers.Services_Impl
{
    public class VoteManagerImpl : IVoteServices, IMainServices
    {

        public float AvgVote(string bookID)
        {
            throw new NotImplementedException();
        }

        public bool ExcuteVoteBook(VoteBean vote)
        {
            SqlCommand command = new SqlCommand();
            command.CommandText = "Insert into [Vote]([Value],[BookID]) Values(@Value,@BookID)";
            command.Parameters.AddWithValue("@Value",vote.Value);
            command.Parameters.AddWithValue("@BookID", vote.BookID);
            return Connect.ExcuteNonQuery(command);
        }

        public bool Delete(System.Data.SqlClient.SqlCommand command)
        {
            throw new NotImplementedException();
        }

        public System.Data.DataTable SelectTable(System.Data.SqlClient.SqlCommand command, String tblName)
        {
            throw new NotImplementedException();
        }

        public bool Update(System.Data.SqlClient.SqlCommand command)
        {
            throw new NotImplementedException();
        }
    }
}
